package com.good.jzhouse.dao;

import com.good.jzhouse.bean.Img;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ImgDao {
    @Select("select * from img")
    List<Img> findAll();

    @Select("select * from img where id=#{id}")
    Img selectById(Integer id);

    @Delete("delete from img where id=#{id}")
    int delete(Integer id);

    @Insert("insert into img values(null,#{imgtxt})")
    Boolean insert(Img img);

    @Update("update img set imgtxt=#{imgtxt} where id=#{id}")
    int update(Img img);

    @Select("select count(1) from img")
    int selectCount();
}
